<template>
  <div class="main_box">
    <router-link to="/control/login/logins">
      <mt-button icon="back">个人中心</mt-button>
    </router-link>
    <input type="text" class="name" placeholder="用户名" v-model="name" />

    <input type="password" class="userpass" placeholder="密码" v-model="password" />
    <input type="password" class="pwd" placeholder="重复密码" v-model="pwd" />

    <button class="login" @click="login">注册</button>
    <!--@click="login"-->
    <div class="register">
      <router-link to="/user/register" tag="span">忘记密码</router-link>
      <span>|</span>
      <router-link to="/control/login/logins" tag="span">立即登录</router-link>
    </div>
  </div>
</template>
<script>
export default {
    data() {
        return {
            name:"",
            password:"",
            pwd:"",
            img:"http://127.0.0.1/homework/my-ying/img/82.jpg"
        }
    },
    methods:{
        login(){
            if(this.password !== this.pwd ){
                return false;
            }
            let data = new FormData();
            data.append("img",this.img)
            data.append("name",this.name)
            data.append("password",this.password)            
            this.axios
            .post("http://127.0.0.1/homework/my-ying/php/forget_pwd.php",data)
            .then(res=>{
                console.log(res.data)
                document.cookie = "name="+this.name;               
                location.href = "#/control/login/logins"
                console.log(this.name)
            })
        }
    },
};
</script>
<style lang="less" scoped>
.mint-button--default {
  background-color: rgba(255, 0, 0, 0);
}
.tip {
  text-align: center;
  color: black;
}
.logo {
  display: block;
  margin: 20px auto;
  border-radius: 8px;
}
.main_box {
  width: 100%;
  padding-bottom: 60px;
  height: 100%;
}
.main_box.box {
  padding-left: 20px;
  padding-right: 20px;
  background: white;
}
.main_box > input {
  border: none;
  border-bottom: 1px solid rgb(98, 98, 98);
  margin-top: 5px;
  border-radius: 0px;
}
.main_box > button {
  display: block;
  border-radius: 6px;
  width: 100%;
  margin-top: 20px;
  height: 38px;
}
.main_box .login {
  border: none;
  height: 40px;
  background-color: rgb(255, 123, 0);
  color: white;
  font-size: 18px;
  font-family: "楷体";
}
.main_box .login_by_msg {
  border: 1px solid rgb(255, 123, 0);
  height: 38px;
  color: rgb(255, 123, 0);
  font-size: 18px;
  font-family: "楷体";
}
.register {
  width: 100%;
  text-align: center;
  height: 44px;
  line-height: 44px;
  font-size: 16px;
  color: #626262;
}
.login_by_other {
  font-size: 14px;
  color: #626262;
  text-align: center;
}
.other_method {
  display: block;
  margin: 0 auto;
}
.language {
  text-align: center;
  margin-top: 10px;
}
.language > span {
  font-size: 14px;
  color: #909090;
  margin: 0px 4px;
}
.language > .active {
  color: red;
}
</style>
